home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / ControlStrip.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.6 KB  |  400 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ControlStrip.a
  3. ;
  4. ;    Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5. ;
  6. ;    Version:    Technology:    ControlStrip 1.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc. All rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__CONTROLSTRIP__') = 'UNDEFINED' THEN
  18. __CONTROLSTRIP__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  24.     include 'Menus.a'
  25.     ENDIF
  26.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  27.     include 'Dialogs.a'
  28.     ENDIF
  29.  
  30. ; *********************************************************************************************
  31. ;
  32. ;    messages passed to the modules
  33. ;
  34. ;********************************************************************************************
  35.  
  36.  
  37. sdevInitModule                    EQU        0                    ; initialize the module
  38. sdevCloseModule                    EQU        1                    ; clean up before being closed
  39. sdevFeatures                    EQU        2                    ; return feature bits
  40. sdevGetDisplayWidth                EQU        3                    ; returns the width of the module's display
  41. sdevPeriodicTickle                EQU        4                    ; periodic tickle when nothing else is happening
  42. sdevDrawStatus                    EQU        5                    ; update the interface in the Control Strip
  43. sdevMouseClick                    EQU        6                    ; user clicked on the module's display area in the Control Strip
  44. sdevSaveSettings                EQU        7                    ; saved any changed settings in module's preferences file
  45. sdevShowBalloonHelp                EQU        8                    ; puts up a help balloon, if the module has one to display
  46. ; *********************************************************************************************
  47. ;
  48. ;    Features supported by the module.  If a bit is set, it means that feature is supported.
  49. ;    All undefined bits are reserved for future use by Apple, and should be set to zero.
  50. ;
  51. ;********************************************************************************************
  52.  
  53.  
  54. sdevWantMouseClicks                EQU        0                    ; notify the module of mouseDown events
  55. sdevDontAutoTrack                EQU        1                    ; call the module to do mouse tracking
  56. sdevHasCustomHelp                EQU        2                    ; module provides its own help messages
  57. sdevKeepModuleLocked            EQU        3                    ; module needs to be locked in the heap
  58. ; *********************************************************************************************
  59. ;
  60. ;    Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  61. ;    If a bit is set, the module can request that a specific function is performed by
  62. ;    the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  63. ;    for future use by Apple, and should be set to zero.
  64. ;
  65. ;********************************************************************************************
  66.  
  67.  
  68. sdevResizeDisplay                EQU        0                    ; resize the module's display
  69. sdevNeedToSave                    EQU        1                    ; need to save changed settings, when convenient
  70. sdevHelpStateChange                EQU        2                    ; need to update the help message because of a state change
  71. sdevCloseNow                    EQU        3                    ; close a module because it doesn't want to stay around
  72.  
  73. ; *********************************************************************************************
  74. ;
  75. ;    miscellaneous
  76. ;
  77. ;********************************************************************************************
  78.  
  79.  
  80. sdevFileType                    EQU        'sdev'                ; module's file type
  81.  
  82. sdevMenuItemMark                EQU        $A5                    ; ‘•’: ‘checkmark’ to use in popup menus
  83.  
  84. ;     direction values for SBDrawBarGraph
  85.  
  86.  
  87. BarGraphSlopeLeft                EQU        -1                    ; max end of sloping bar graph is on the left
  88. BarGraphFlatRight                EQU        0                    ; max end of flat bar graph is on the right
  89. BarGraphSlopeRight                EQU        1                    ; max end of sloping bar graph is on the right
  90. ; *********************************************************************************************
  91. ;
  92. ;    utility routines to provide standard interface elements and support for common functions
  93. ;
  94. ;********************************************************************************************
  95.  
  96. ;
  97. ; pascal Boolean SBIsControlStripVisible(void )
  98. ;
  99.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  100.         Macro
  101.         _SBIsControlStripVisible
  102.             moveq               #0,D0
  103.             dc.w                $AAF2
  104.         EndM
  105.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  106.         IMPORT_CFM_FUNCTION SBIsControlStripVisible
  107.     ENDIF
  108.  
  109. ;
  110. ; pascal void SBShowHideControlStrip(Boolean showIt)
  111. ;
  112.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  113.         Macro
  114.         _SBShowHideControlStrip
  115.             move.w              #$0101,D0
  116.             dc.w                $AAF2
  117.         EndM
  118.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  119.         IMPORT_CFM_FUNCTION SBShowHideControlStrip
  120.     ENDIF
  121.  
  122. ;
  123. ; pascal Boolean SBSafeToAccessStartupDisk(void )
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  126.         Macro
  127.         _SBSafeToAccessStartupDisk
  128.             moveq               #2,D0
  129.             dc.w                $AAF2
  130.         EndM
  131.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  132.         IMPORT_CFM_FUNCTION SBSafeToAccessStartupDisk
  133.     ENDIF
  134.  
  135. ;
  136. ; pascal short SBOpenModuleResourceFile(OSType fileCreator)
  137. ;
  138.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  139.         Macro
  140.         _SBOpenModuleResourceFile
  141.             move.w              #$0203,D0
  142.             dc.w                $AAF2
  143.         EndM
  144.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  145.         IMPORT_CFM_FUNCTION SBOpenModuleResourceFile
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  152.         Macro
  153.         _SBLoadPreferences
  154.             move.w              #$0404,D0
  155.             dc.w                $AAF2
  156.         EndM
  157.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION SBLoadPreferences
  159.     ENDIF
  160.  
  161. ;
  162. ; pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  165.         Macro
  166.         _SBSavePreferences
  167.             move.w              #$0405,D0
  168.             dc.w                $AAF2
  169.         EndM
  170.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  171.         IMPORT_CFM_FUNCTION SBSavePreferences
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  176. ;
  177.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  178.         Macro
  179.         _SBGetDetachedIndString
  180.             move.w              #$0506,D0
  181.             dc.w                $AAF2
  182.         EndM
  183.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  184.         IMPORT_CFM_FUNCTION SBGetDetachedIndString
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  189. ;
  190.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  191.         Macro
  192.         _SBGetDetachIconSuite
  193.             move.w              #$0507,D0
  194.             dc.w                $AAF2
  195.         EndM
  196.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  197.         IMPORT_CFM_FUNCTION SBGetDetachIconSuite
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal short SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  202. ;
  203.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  204.         Macro
  205.         _SBTrackPopupMenu
  206.             move.w              #$0408,D0
  207.             dc.w                $AAF2
  208.         EndM
  209.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  210.         IMPORT_CFM_FUNCTION SBTrackPopupMenu
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal short SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  215. ;
  216.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  217.         Macro
  218.         _SBTrackSlider
  219.             move.w              #$0409,D0
  220.             dc.w                $AAF2
  221.         EndM
  222.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  223.         IMPORT_CFM_FUNCTION SBTrackSlider
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  228. ;
  229.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  230.         Macro
  231.         _SBShowHelpString
  232.             move.w              #$040A,D0
  233.             dc.w                $AAF2
  234.         EndM
  235.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION SBShowHelpString
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal short SBGetBarGraphWidth(short barCount)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  243.         Macro
  244.         _SBGetBarGraphWidth
  245.             move.w              #$010B,D0
  246.             dc.w                $AAF2
  247.         EndM
  248.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION SBGetBarGraphWidth
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  256.         Macro
  257.         _SBDrawBarGraph
  258.             move.w              #$050C,D0
  259.             dc.w                $AAF2
  260.         EndM
  261.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION SBDrawBarGraph
  263.     ENDIF
  264.  
  265. ;
  266. ; pascal void SBModalDialogInContext(ModalFilterUPP filterProc, short *itemHit)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  269.         Macro
  270.         _SBModalDialogInContext
  271.             move.w              #$040D,D0
  272.             dc.w                $AAF2
  273.         EndM
  274.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  275.         IMPORT_CFM_FUNCTION SBModalDialogInContext
  276.     ENDIF
  277.  
  278. ;  The following routines are available in Control Strip 1.2 and later. 
  279. ;
  280. ; pascal OSErr SBGetControlStripFontID(short *fontID)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  283.         Macro
  284.         _SBGetControlStripFontID
  285.             move.w              #$020E,D0
  286.             dc.w                $AAF2
  287.         EndM
  288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION SBGetControlStripFontID
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal OSErr SBSetControlStripFontID(short fontID)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  296.         Macro
  297.         _SBSetControlStripFontID
  298.             move.w              #$010F,D0
  299.             dc.w                $AAF2
  300.         EndM
  301.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION SBSetControlStripFontID
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal OSErr SBGetControlStripFontSize(short *fontSize)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  309.         Macro
  310.         _SBGetControlStripFontSize
  311.             move.w              #$0210,D0
  312.             dc.w                $AAF2
  313.         EndM
  314.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  315.         IMPORT_CFM_FUNCTION SBGetControlStripFontSize
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal OSErr SBSetControlStripFontSize(short fontSize)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  322.         Macro
  323.         _SBSetControlStripFontSize
  324.             move.w              #$0111,D0
  325.             dc.w                $AAF2
  326.         EndM
  327.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION SBSetControlStripFontSize
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal OSErr SBGetShowHideHotKey(short *modifiers, unsigned char *keyCode)
  333. ;
  334.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  335.         Macro
  336.         _SBGetShowHideHotKey
  337.             move.w              #$0412,D0
  338.             dc.w                $AAF2
  339.         EndM
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION SBGetShowHideHotKey
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal OSErr SBSetShowHideHotKey(short modifiers, unsigned char keyCode)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _SBSetShowHideHotKey
  350.             move.w              #$0213,D0
  351.             dc.w                $AAF2
  352.         EndM
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION SBSetShowHideHotKey
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal OSErr SBIsShowHideHotKeyEnabled(Boolean *enabled)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  361.         Macro
  362.         _SBIsShowHideHotKeyEnabled
  363.             move.w              #$0214,D0
  364.             dc.w                $AAF2
  365.         EndM
  366.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  367.         IMPORT_CFM_FUNCTION SBIsShowHideHotKeyEnabled
  368.     ENDIF
  369.  
  370. ;
  371. ; pascal OSErr SBEnableShowHideHotKey(Boolean enabled)
  372. ;
  373.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  374.         Macro
  375.         _SBEnableShowHideHotKey
  376.             move.w              #$0115,D0
  377.             dc.w                $AAF2
  378.         EndM
  379.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION SBEnableShowHideHotKey
  381.     ENDIF
  382.  
  383. ;  The following routines are available in Control Strip 1.4 and later. 
  384. ;
  385. ; pascal short SBHitTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue, Boolean *hit)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  388.         Macro
  389.         _SBHitTrackSlider
  390.             move.w              #$0616,D0
  391.             dc.w                $AAF2
  392.         EndM
  393.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  394.         IMPORT_CFM_FUNCTION SBHitTrackSlider
  395.     ENDIF
  396.  
  397.  
  398.     ENDIF ; __CONTROLSTRIP__ 
  399.  
  400.